<template>
  <div class="photo_detail">
    <div class="photo_big">
      <div class="photo_small" v-for="(item,index) in src" :key="index" @click="spreadPicture(item)">
        <img v-show="!!item.picUrl" v-lazy="item.picUrl" alt="">
        <van-loading v-show="!(!!item.picUrl)"/>
      </div>
    </div>
    <van-overlay :show="show" duration="0">
      <div class="close" ><van-icon name="cross" @click="closeOverlay"/></div>
      <div class="show_photo">
        <img :src="showPicture" alt="">
      </div>
      <div class="phone" @click="phone">
        <span>电话咨询</span>
      </div>
    </van-overlay>
  </div>
</template>

<script>
export default {
  data() {
    return {
      show: false,
      src: [],
      showPicture: ''
    }
  },
  methods: {
    spreadPicture(n) {
      console.log(n)
      this.show = true
      this.showPicture = n.picUrl
    },
    closeOverlay() {
      this.show = false
    },
    // 电话咨询
    phone() {

    }
  },
  mounted() {
    document
      .querySelector("body")
      .setAttribute("style", "background-color:white")
    console.log(this.$route.query)
    this.src = this.$route.query.data
  },
}
</script>

<style scoped lang="less">
  .van-overlay{
    background-color: black;
  }
  .photo_detail{
    background-color: white;
    padding: 20px 15px;
    .photo_big{
      display: flex;
      flex-wrap: wrap;
      text-align: center;
      .photo_small{
        width: 30%;
        height: 100px;
        background-color: #F8F8F8;
        margin: 0 5px 10px 5px;
        border-radius: 5px;
        img{
          width: 100%;
          height: 100%;
          background-image: cover;
          border-radius: 5px;
        }
      }
      
    }
    .close{
      font-size: 25px;
      color: white;
      padding: 10px;
    }
    .show_photo{
      width: 100%;
      height: 40vh;
      margin-top: 18vh;
      background-color: #F8F8F8;
      img{
        width: 100%;
        height: 100%;
      }
    }
    .phone{
      margin-top: 20px;
      text-align: center;
      span{
        background-color: white;
        padding: 10px 100px;
        border-radius: 50px;
        color: #FF571A;
        font-size: 18px;
        font-weight: 550;
        // border: 1px solid #FF571A;
      }
    }
  }
</style>